package com.security.door.controller.deviceManage;

import com.security.door.core.wrapper.WrapMapper;
import com.security.door.core.wrapper.Wrapper;
import com.security.door.model.dto.deviceparamDto;
import com.security.door.service.IdevDeviceparamService;
import io.swagger.annotations.Api;
import io.swagger.annotations.ApiOperation;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.http.MediaType;
import org.springframework.web.bind.annotation.PostMapping;
import org.springframework.web.bind.annotation.RequestBody;
import org.springframework.web.bind.annotation.RestController;

import javax.servlet.http.HttpServletRequest;
import javax.servlet.http.HttpSession;
import java.util.List;

@RestController
@Api(value = "WEB - devDeviceparamController", produces = MediaType.APPLICATION_JSON_UTF8_VALUE)
public class devDeviceparamController {

    @Autowired
    HttpSession session;
    @Autowired
    HttpServletRequest httpServletRequest;
    @Autowired
    IdevDeviceparamService idevDeviceparamService;

    @PostMapping("/deviceparam/selectByDeviceCode")
    @ApiOperation(value = "根据区域查询设备树", notes = "根据区域查询设备树")
    public Wrapper selectByDeviceCode(@RequestBody deviceparamDto entityDto) {
        var list = idevDeviceparamService.selectByDeviceCode(entityDto.getDevicecode(), entityDto.getActivecode());
        return WrapMapper.ok(list);
    }
}
